import request from "@/router/axios";

export const getPage = (page, params) => {
  return request({
    url: '/api/uic-system/fillteam/page',
    method: 'get',
    params: {
      ...page,
      ...params,
    }
  })
}

export const getTeamdongfengPage = (page, params) => {
    return request({
        url: '/api/uic-business/teamdongfeng/page',
        method: 'get',
        params: {
            ...page,
            ...params,
        }
    })
}

export const save = (form) => {
  return request({
    url: '/api/uic-system/fillteam/save',
    method: 'post',
    data: {
      ...form
    }
  })
}

export const update = (form) => {
  return request({
    url: '/api/uic-system/fillteam/update',
    method: 'post',
    data: {
      ...form
    }
  })
}


export const frozen = (id) => {
  return request({
    url: '/api/uic-system/fillteam/updateStatus',
    method: 'post',
    data: {
      id,
      teamStatus: 0
    }
  })
}

export const unfrozen = (id) => {
  return request({
    url: '/api/uic-system/fillteam/updateStatus',
    method: 'post',
    data: {
      id,
      teamStatus: 1
    }
  })
}

export const deleteRecord = (id) => {
  return request({
    url: '/api/uic-system/fillteam/remove',
    method: 'post',
    params: {
      ids: id
    }
  })
}

export const resetPwd = (id) =>{
  return request({
    url: '/api/uic-system/fillteamaccount/reset-password',
    method: 'post',
    params: {
      userIds: id
    }
  })
}

export const open = (id) =>{
  return request({
    url: '/api/uic-system/fillteamaccount/updateUserStatus',
    method: 'post',
    data: {
      teamId: id,
      userStatus: 0
    }
  })
}

export const close = (id) =>{
  return request({
    url: '/api/uic-system/fillteamaccount/updateUserStatus',
    method: 'post',
    data: {
      teamId: id,
      userStatus: 1
    }
  })
}


export const recordTeamdongfengDetail = (id) => {
  return request({
    url: '/api/uic-business/teamdongfeng/detail',
    method: 'get',
    params: {id}
  })
}

export const recordDetail = (id) => {
    return request({
        url: '/api/uic-system/fillteam/detail',
        method: 'get',
        params: {id}
    })
}


export const fillTeamWaterRecordPage = (page, params) => {
  return request({
    url: '/api/uic-system/fillteamwaterrecord/page',
    method: 'get',
    params: {
      ...page,
      ...params,
    }
  })
}

// 获取授权信息
export const fillTeamWaterSummary = (teamId) => {
  return request({
    url: `/api/uic-system/fillteamcard/${teamId}/summary`,
    method: 'get',
  })
}

// 增加授信
export const addFillTeamWater = (teamId, balanceMoney) => {
  return request({
    url: `/api/uic-system/fillteamwaterrecord/save`,
    method: 'post',
    data: {
      teamId,
      balanceMoney
    }
  })
}
